<?php

if (@$_GET['stu'] == "")
	$stu = 0;
else
	$stu = $_GET['stu'];

if (@$_GET['stg'] == "")
	$stg = 0;
else
	$stg = $_GET['stg'];

if ((@$_POST['type'] == 1) || (@$_POST['type'] == 2))
{
	Print("
		<div id=\"box\">
			<h3>Utilisateurs</h3>
			<div style=\"border:1px gray dotted; height:275px;\">
			<table width=100% cellpading=0 cellspacing=0 border=0 class=\"tab_over_1\">
				<thead>
					<tr>
						<th width=1% align=left><font color=royalblue>UID</font></th>
						<th width=15% align=left><font color=royalblue>Login</font></th>
						<th width=30% align=left><font color=royalblue>E-Mail</font></th>
						<th width=15% align=left><font color=royalblue>Last login</font></th>
						<th width=10% align=center><font color=royalblue>Actions</font></th>
					</tr>
				</thead>");
				$gr = show_users_search($stu, 10, @$_POST['name']);
				Print("</table>");
			if ($gr == -1)
				Print("<center><b><font color=#4B4B4B>Pas de r&eacute;sultat pour la recherche d'utilisateurs!</font></b></center>");
			Print("</div>");
			
			$name = @$_POST['name'];
			$table_users_auth = $_SESSION['prefix']."users_auth";
			$req = "SELECT uid FROM $table_users_auth WHERE login LIKE \"$name%\"";
			show_page_search($stg, 10, $req, "users.php?page=search&stu");
			
		Print("</div>");
}

if ((@$_POST['type'] == 1) || (@$_POST['type'] == 3))
{
	if (@$_POST['type'] == 1)
		Print("<br><br>");
	
	Print("
		<div id=\"box\">
			<h3>Groupes</h3>
			<div style=\"border:1px gray dotted; height:275px;\">
			<table width=100% cellpading=0 cellspacing=0 border=0 class=\"tab_over_1\">
				<thead>
					<tr>
						<th width=1% align=left><font color=royalblue>GID</font></th>
						<th width=15% align=left><font color=royalblue>Nom</font></th>
						<th width=50% align=left><font color=royalblue>Description</font></th>
						<th width=10% align=center><font color=royalblue>Actions</font></th>
					</tr>
				</thead>");
				$gr = show_groups_search($stg, 10, @$_POST['name']);
				Print("</table>");
			if ($gr == -1)
				Print("<center><b><font color=#4B4B4B>Pas de r&eacute;sultat pour la recherche de groupes!</font></b></center>");
			Print("</div>");
			
			$name = @$_POST['name'];
			$table_groups = $_SESSION['prefix']."groups";
			$req = "SELECT gid FROM $table_groups WHERE title LIKE \"$name%\"";
			show_page_search($stg, 10, $req, "users.php?page=search&stg");
			
		Print("</div>
	");
}



?>